/*
 * @Description: 
 * @Author: zoe
 * @Date: 2024-09-19 19:30:53
 * @LastEditors: rendc
 * @LastEditTime: 2024-09-19 19:47:35
 */
public class Truck extends Automobile {
    private String cargoCapacity;  // 卡车的载货量

    public Truck(String brand, String plateNumber, String cargoCapacity) {
        super(brand, plateNumber);
        this.cargoCapacity = cargoCapacity;
    }

    public String getCargoCapacity() {
        return cargoCapacity;
    }

    public void setCargoCapacity(String cargoCapacity) {
        this.cargoCapacity = cargoCapacity;
    }

    @Override
    public double getRent() {
        // 假设每吨载货量的租金为 100 元
        return cargoCapacity * 100;
    }

    @Override
    public String toString() {
        return "Truck{" +
               "brand='" + getBrand() + '\'' +
               ", plateNumber='" + getPlateNumber() + '\'' +
               ", cargoCapacity=" + cargoCapacity +
               '}';
    }
}
